<!--
  -- 描述：假期类别选择字典下拉框
  --
-->
<template>
  <el-select placeholder="请选择" :value="mval" @change="selectHandler" :clearable=true :multiple="multiple">
    <el-option v-for="item in list" :key="item.id" :label="item.name" :value="item.code"></el-option>
  </el-select>
</template>

<script>
  export default {
    name: "DictionarySelect",
    model: {
      prop: 'mval',
      event: 'modelValue'
    },
    props: ['mval', 'multiple', 'parentCode'],
    mounted: function () {

      this.api.post('/bucket-system/system/dict/get', {'type': this.parentCode})
        .then((data) => {
          this.list = data.data;
        });

    },
    data() {
      return {
        list: []
      }
    },
    methods: {
      selectHandler: function (val) {
        this.$emit('modelValue', val)
      }
    }
  }
</script>

